﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace MINERP.COM
{
    public  class MD5HashCode
    {
        public static string GetHash(string pwd)
        {
            byte[] buffer = Encoding.Unicode.GetBytes(pwd);
            string sResult = "";

            MD5 md5 = new MD5CryptoServiceProvider();

            byte[] result = md5.ComputeHash(buffer);
            

            foreach (byte b in result)
            {
                sResult += Convert.ToString(b, 16);
            }

            return sResult;
        }
    }
}
